{% set base = url('addons.ratings.list', addon.slug) %}
{% if collection_uuid %}
    {% set base = base|urlparams(collection_uuid=collection_uuid) %}
{% endif %}

<span class="rating">
  {% with num=addon.total_ratings %}
    {% if num %}
      {{ addon.average_rating|float|stars }}
      <a href="{{ base|absolutify }}">({{ num|numberfmt }})</a>
    {% else %}
      <b>{{ _('Not yet rated') }}</b>
    {% endif %}
  {% endwith %}
</span>
